﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZF.BLL.UserControls
{
    public class TextBox: System.Web.UI.WebControls.TextBox
    {
        protected override void OnLoad(EventArgs e)
        {
            if (this.Attributes["class"] == null)
            {
                this.CssClass += " " + this.ID;
            }
            else
            {
                this.Attributes["class"] += " " + this.ID;
                if (this.Attributes["class"].IndexOf("mmtxt") != -1 ||
                    this.Attributes["class"].IndexOf("mltxt") != -1 ||
                    this.Attributes["class"].IndexOf("mstxt") != -1)
                {
                    this.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine;
                }

            }
            if (!this.IsEnabled)
                this.Attributes["class"] += " disabled";
            base.OnLoad(e);
        }

    }
}
